package com.example.service;

import com.example.pojo.Yonghu;
import com.example.mapper.mapgetlist;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class servicegetlist {
    @Autowired
    private mapgetlist maplist;
    //查询
    public List<Yonghu> getList() {
        List<Yonghu> list=maplist.list();
        return  list;
    }
    public Yonghu getListdan(int id){
        Yonghu list=maplist.listdan(id);
        return  list;
    }
    //创建
    public void add(Yonghu use){
        System.out.println(use);
        maplist.add(use);
    }
    //更新
    public void update( int id ,Yonghu use){
        use.setId(id);
        maplist.update(use);
    }
    //删除
    public void delete(int id){
        maplist.delete(id);
    }


}
